#include "getonlinefriendrequest.h"

#include "getonlinefriendresponse.h"

#include <QUrl>
#include <QDebug>


GetOnlineFriendRequest::GetOnlineFriendRequest(const QString &sessionKey)
    : m_response(new GetOnlineFriendResponse)
    , m_sessionKey(sessionKey)
{
}

GetOnlineFriendRequest::~GetOnlineFriendRequest()
{
    delete m_response;
    m_response = 0;
}


Network::JSONResponse &GetOnlineFriendRequest::jsonResponse()
{
    return *m_response;
}


const Network::JSONResponse &GetOnlineFriendRequest::jsonResponse() const
{
    return *m_response;
}


QUrl GetOnlineFriendRequest::url() const
{
    QString url = QString("http://mapi2.me.zing.vn/frs/mapi2/messchat?method=mess.getallfriendonline&session_key=%1")
            .arg(m_sessionKey);

    return QUrl(url);
}
